<?php
class Zend_View_Helper_Post
{
    public $view;
    public function post ($post)
    {
        $html = ' <div class="post">
                        <h2><a href="/blog/view/id/' . $post->blog->id . '"> '. $post->blog->name .'</a> → <a href="/post/view/id/' . $post->id . '">' . $post->title . '</a></h2>
                        <div class="date">' . $post->date . '</div>
                        <div class="body">
                           ' . $post->text . '
                        </div>
                        <div class="metadata">
                            <div class="left">
                                <a href="/post/view/id/' . $post->id . '"><span class="comment">' . $post->commentsCount . '</span></a>
                            </div> 
                            <a href="/post/update/id/' . $post->id . '">&nbsp;Редактировать</a>
                            <a href="/post/delete/id/' . $post->id . '">&nbsp;Удалить</a>
                            <div class="clearer"></div>
                        </div>
                    </div>';
        return $html;
    }
    public function setView (Zend_View_Interface $view)
    {
        $this->view = $view;
    }
}